<template>
	<view>
		<web-view :src="url"></web-view>
	</view>
</template>

<script>
	import amap from '../../js_sdk/amap-wx.130.js';
	var _self;
	export default {
		data() {
			return {
				url: '',
				title: '',
				amapPlugin: null,
				gaodekey: '5a96bccf3666231d3e8d55ddd31f8120', //高德key,此处的key需要去高德平台申请获取
			}
		},
		methods: {

		},
		onLoad(option) {
			_self = this;
			//保险页面回调
			//_self.url='https://pay.swiftpass.cn/pay/jspay?showwxtitle=1&token_id=21fd612b26f24ca9267b95cdfd538f2f9';
			// var paramtext = 'id=' + '123456987' + '&phone=' + '18859767532'
			// 	+ '&startStation=' + '南平武夷客运总站' + '&endStation=' + '光泽汽车站';
			// _self.url = 'http://wyzzwx.xmjdt.com/Coach/OtherWxLogin?'+ paramtext;
			//_self.url = 'https://wx.17u.cn/busexternal/?cid=0096&refid=675005066&dep=&des=&depStation=&desStation=&pid=&aid=5096&userOpenid=owP8swK9N08Xjk6BW65PJjQhLLkw#/';
			_self.url =
				'https://iopen.ccic-net.com.cn/management-service/rest/v1/epolicy/download/P5VA23350114250000000002-C561074575741FA27D02E3CBC8AC4ECF883271E627CAFDFDC629ACCE9F2E69F7';
			wx.downloadFile({ //将文档下载到本地
				url: _self.url, //pdf链接
				success(res) {
					wx.openDocument({ //打开文档
						filePath: res.tempFilePath, //本地文档路径
						fileType: "pdf", //文档类型
						showMenu: true,
						success: function(res) {
							wx.showToast({
								title: '打开文档成功',
							})
						},
						fail: function(res) {
							wx.showToast({
								title: '打开文档失败',
							})
						},
					})
				},
			})
		},
		onShow() {
			//在onshow做延时操作才可以把导航标题改掉
			setTimeout(function() {
				uni.setNavigationBarTitle({
					title: _self.title
				});
			}, 1000)
		}
	}
</script>

<style>

</style>